//
//  UIView+extension.m
//  netEasy
//
//  Created by mac on 15/10/31.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "UIView+extension.h"

@implementation UIView (extension)
/**
 *  设置X
 *
 *  @param x <#x description#>
 */
-(void)setX:(CGFloat)x
{
    CGRect rect = self.frame;
    rect.origin.x=x;
    self.frame = rect;
}
/**
 *  直接获得X
 *
 *  @return <#return value description#>
 */
-(CGFloat)x
{

    return self.frame.origin.x;
}
/**
 *  设置Y
 *
 *  @param y <#y description#>
 */
-(void)setY:(CGFloat)y
{
    CGRect rect =self.frame;
    rect.origin.y=y;
    self.frame = rect;
}
/**
 *  直接获得Y
 *
 *  @return <#return value description#>
 */
-(CGFloat)y
{

    return self.frame.origin.y;
}
/**
 *  直接设置宽度WIDTH
 *
 *  @param width <#width description#>
 */
-(void)setWidth:(CGFloat)width
{
    CGRect rect = self.frame;
    rect.size.width=width;
    self.frame = rect;

}
/**
 *  直接获得WIDTH
 *
 *  @return <#return value description#>
 */
-(CGFloat)width
{

    return self.frame.size.width;
}
/**
 *  直接设置HEIGHT
 *
 *  @param height <#height description#>
 */
-(void)setHeight:(CGFloat)height
{
    CGRect rect = self.frame;
    rect.size.height= height;
    self.frame = rect;

}
/**
 *  直接获得HEIGHT
 *
 *  @return
 */
-(CGFloat)height
{

    return self.frame.size.height;
}
/**
 *  直接设置中心点CENTERX
 *
 *  @param centerX <#centerX description#>
 */
-(void)setCenterX:(CGFloat)centerX
{
    CGPoint center = self.center;
    center.x = centerX;
    self.center = center;
}
/**
 *  直接获得中心点CENTERX
 *
 *  @return
 */
-(CGFloat)centerX
{

    return self.center.x;
}
/**
 *  直接设置centerY
 *
 *  @param centerY <#centerY description#>
 */
-(void)setCenterY:(CGFloat)centerY
{

    CGPoint center = self.center;
    center.y = centerY;
    self.center = center;


}
/**
 *  直接获得centerY
 *
 *  @return <#return value description#>
 */
-(CGFloat)centerY
{

    return self.center.y;

}

/**
 *  设置SIZE
 *
 *  @param size <#size description#>
 */
-(void)setSize:(CGSize)size
{

    CGRect rect = self.frame;
    
    rect.size=size;
    
    self.frame = rect;
    
}
/**
 *  直接得到SIZE
 *
 *  @return <#return value description#>
 */
-(CGSize)size
{

    return self.frame.size;

}

@end
